import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:goodpromise_iap/goodpromise_iap.dart';

void main() {
  const MethodChannel channel = MethodChannel('goodpromise_iap');

  TestWidgetsFlutterBinding.ensureInitialized();

  setUp(() {
    channel.setMockMethodCallHandler((MethodCall methodCall) async {
      return '42';
    });
  });

  tearDown(() {
    channel.setMockMethodCallHandler(null);
  });

  test('submitIAPRequest', () async {
    GoodpromiseIap.onListenPayment((p0) {
      print("=============== 支付结果 ===============");
      print("$p0");
    });
    GoodpromiseIap.submitIAPRequest("goodpromise.vip.annual.20220120");
  });
}
